// component/tab-bar/index.js
const config = require('../../config')
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    tabbarActive: Number, // 当前选中的分页索引
    isShow: Boolean
  },
  isRealname: {
    type: String,
    value: ''
  },

  /**
   * 组件的初始数据
   */
  data: {
    isShow: true,
    // icon: {
    //   normal: 'http://feiyangimage.oss-cn-shanghai.aliyuncs.com/wxApplets/icon/home-unselset.png',
    //   active: 'http://feiyangimage.oss-cn-shanghai.aliyuncs.com/wxApplets/icon/home-select.png',
    // },
    // icon1: {
    //   normal: 'http://feiyangimage.oss-cn-shanghai.aliyuncs.com/wxApplets/icon/cardConect-unselcet.png',
    //   active: 'http://feiyangimage.oss-cn-shanghai.aliyuncs.com/wxApplets/icon/cardConect-selcet.png',
    // },
    // icon2: {
    //   normal: 'http://feiyangimage.oss-cn-shanghai.aliyuncs.com/wxApplets/icon/cardConect1-unselcet.png',
    //   active: 'http://feiyangimage.oss-cn-shanghai.aliyuncs.com/wxApplets/icon/cardConect1-selcet.png',
    // },
    // icon3: {
    //   normal: 'http://feiyangimage.oss-cn-shanghai.aliyuncs.com/wxApplets/icon/see-unselect.png',
    //   active: 'http://feiyangimage.oss-cn-shanghai.aliyuncs.com/wxApplets/icon/see-select.png',
    // },
    // icon4: {
    //   normal: 'http://feiyangimage.oss-cn-shanghai.aliyuncs.com/wxApplets/yearCard/packUnselect.png',
    //   active: 'http://feiyangimage.oss-cn-shanghai.aliyuncs.com/wxApplets/yearCard/packSelect.png',
    // },
    icon: {
      normal: 'http://feiyangimage.oss-cn-shanghai.aliyuncs.com/wxApplets/newCoup/real-names.png',
      active: 'http://feiyangimage.oss-cn-shanghai.aliyuncs.com/wxApplets/newCoup/real-names.png',
    },
    icon1: {
      normal: 'http://feiyangimage.oss-cn-shanghai.aliyuncs.com/wxApplets/newCoup/connect-servess.png',
      active: 'http://feiyangimage.oss-cn-shanghai.aliyuncs.com/wxApplets/newCoup/connect-servess.png',
    },
    icon2: {
      normal: 'http://feiyangimage.oss-cn-shanghai.aliyuncs.com/wxApplets/newCoup/connect-servess.png',
      active: 'http://feiyangimage.oss-cn-shanghai.aliyuncs.com/wxApplets/newCoup/connect-servess.png',
    },
    icon3: {
      normal: 'http://feiyangimage.oss-cn-shanghai.aliyuncs.com/wxApplets/newCoup/active-introducts.png',
      active: 'http://feiyangimage.oss-cn-shanghai.aliyuncs.com/wxApplets/newCoup/active-introducts.png',
    },
    icon4: {
      normal: 'http://feiyangimage.oss-cn-shanghai.aliyuncs.com/wxApplets/newCoup/myCoup-coups.png',
      active: 'http://feiyangimage.oss-cn-shanghai.aliyuncs.com/wxApplets/newCoup/myCoup-coups.png',
    },
    tabbarActive: 0,
  },
  /**
   * 组件的方法列表
   */
  methods: {
    onChange(event) {
      // event.detail 的值为当前选中项的索引
      this.setData({
        tabbarActive: event.detail
      });
    },
    click_show() {
      this.setData({
        tabbarActive: 0
      });
      this.triggerEvent("click_show", '')
    },
    // toOrder() { onClickShow
    //   this.triggerEvent("toOrder", '')
    // },
    toOrder() { 
      this.triggerEvent("onClickShow", '')
    },
    toCardPack() {
      console.log("卡包")
      this.triggerEvent("toCardPack", '')
    },
    toCardPack() {
      console.log("卡包")
      this.triggerEvent("goCoup", '')
    },
    // toIndex() { 
    //   this.triggerEvent("toIndex", '')
    // }
    toIndex() {
      this.triggerEvent("toIndex", '')
    }
  }
})